﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace NpCrm.Domain
{
    public class Role : NpCrmEntityBase
    {
        [Key]
        [DatabaseGenerated(DatabaseGenerationOption.Identity)]
        public int RoleId { get; set; }

        [Required(ErrorMessage = "Please enter a user name.")]
        [StringLength(50, ErrorMessage = "Role name too long.")]
        public string RoleName { get; set; }

        public virtual ICollection<User> Users { get; set; }

        public Role()
        {
            Users = new HashSet<User>();
        }
    }
}
